package cn.codeforfun.gitee.config.impl;

import cn.codeforfun.gitee.config.GiteeConfigStorage;
import lombok.Data;

/**
 * @author wangbin
 */
@Data
public class GiteeConfigStorageImpl implements GiteeConfigStorage {
    private String token;
    private String clientId;
    private String clientSecret;
    private String username;
    private String password;
    private Integer createdAt;
    private Integer expiresIn;

    @Override
    public boolean isTokenExpired() {
        return System.currentTimeMillis() > (this.expiresIn + this.createdAt) * 1000L;
    }
}
